package com.atguigu.spring.webflux.controller;

import com.atguigu.spring.webflux.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * @author zp
 * @date 2019/4/15
 * @time 下午9:12
 * @discription 基于springMVC的webflux写法
 **/
@RestController
public class HelloWebFluxController {

    @GetMapping("/helloWebFlux")
    public String hello() {
        return "Hello, WebFlux !";
    }

    @GetMapping("/user")
    public Mono<User> getUser() {
        User user = new User();
        user.setUserName("岳不群");
        user.setDesc("辟邪剑谱 天下无双");
        return Mono.just(user);
    }


}

